package com.example.day1101;

/**
 * @author Lenovo
 */
public class AnimalDemo {
    public static void main(String[] args) {
        Animal a = new Cat();
        a.setName("加菲猫");
        a.setAge(5);
        System.out.println(a.getName() + "," + a.getAge());
        a.eat();
        a = new Cat("加菲",5);
        System.out.println(a.getName() + "," + a.getAge());
        a.eat();
    }
}
